package com.tjetc.dao;

import com.tjetc.domain.TeamScore;
import com.tjetc.utils.Db;
import org.apache.commons.dbutils.*;
import org.apache.commons.dbutils.handlers.BeanListHandler;

import java.sql.SQLException;
import java.util.List;

public class TeamScoreDao {
    public List<TeamScore> findTeamScore() throws SQLException {
        QueryRunner queryRunner = new QueryRunner();
        //开启下划线->驼峰转换所用
        BeanProcessor bean = new GenerousBeanProcessor();
        RowProcessor processor = new BasicRowProcessor(bean);
        return Db.runner.query("select * from team_score",new BeanListHandler<>(TeamScore.class,processor));
    }
}
